package com.maimao.order.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.info.input.UseCouponInput;
import com.maimao.order.client.factory.CouponFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author MaoLin Wang
 * @date 2021/1/15 2:16 下午
 */
@RequestMapping("/info/coupon")
@FeignClient(contextId = "couponClient", value = ServiceContainer.INFO_SERVICE, fallbackFactory = CouponFallBackFactory.class, configuration = FeignInterceptor.class)
public interface CouponClient {

    /**
     * 下单时修改用户优惠券使用状态
     */
    @PostMapping("/client/use-coupon")
    public Result<Void> useCoupon(@RequestBody UseCouponInput useCouponInput);
}
